import requests
from config import url_cloud,headers_web

class LaboratoryOpenTime:
    def __int__(self):
        self.url = url_cloud
        self.headers = headers_web

    @classmethod
    def post_withimmediateeffect(cls,url_cloud:str,headers=headers_web,params=None,json=None):
        '''
        summary:立即生效预约时间配置
        description:云课堂web管理调用
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/ICloudClassroomDev/v1/laboratoryopentime/withimmediateeffect"
        r = requests.post(url=url,headers=headers,params=params,json=json)
        return r

    @classmethod
    def post_laboratoryopentime(cls,url_cloud:str,headers=headers_web,params=None,json=None):
        '''
        summary:获取预约时间配置列表信息
        description:云课堂web管理调用
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/ICloudClassroomDev/v1/laboratoryopentime/laboratoryopentime"
        r = requests.post(url=url,headers=headers,params=params,json=json)
        return r

    @classmethod
    def post_dellaboratoryopentime(cls, url_cloud: str, headers=headers_web, params=None, json=None):
        '''
        summary:删除预约时间配置信息
        description:云课堂web管理调用
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/ICloudClassroomDev/v1/laboratoryopentime/deletelaboratoryopentime"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_addlaboratoryopentime(cls, url_cloud: str, headers=headers_web, params=None, json=None):
        '''
        summary:新增预约时间段
        description:云课堂web管理调用
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/ICloudClassroomDev/v1/laboratoryopentime/creationlaboratoryopentime"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r